load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "binloginfo",
    srcs = ["binloginfo.go"],
    importpath = "github.com/pingcap/tidb/pkg/sessionctx/binloginfo",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/config",
        "//pkg/kv",
        "//pkg/metrics",
        "//pkg/parser",
        "//pkg/parser/format",
        "//pkg/parser/terror",
        "//pkg/sessionctx",
        "//pkg/tidb-binlog/node",
        "//pkg/tidb-binlog/pump_client",
        "//pkg/util/logutil",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_tipb//go-binlog",
        "@org_golang_google_grpc//:grpc",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "binloginfo_test",
    timeout = "short",
    srcs = [
        "binloginfo_test.go",
        "main_test.go",
    ],
    embed = [":binloginfo"],
    flaky = True,
    shard_count = 11,
    deps = [
        "//pkg/autoid_service",
        "//pkg/ddl",
        "//pkg/domain",
        "//pkg/kv",
        "//pkg/parser/mysql",
        "//pkg/parser/terror",
        "//pkg/sessionctx",
        "//pkg/sessionctx/variable",
        "//pkg/table/tables",
        "//pkg/testkit",
        "//pkg/testkit/external",
        "//pkg/testkit/testsetup",
        "//pkg/tidb-binlog/pump_client",
        "//pkg/types",
        "//pkg/util/codec",
        "//pkg/util/collate",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_failpoint//:failpoint",
        "@com_github_pingcap_tipb//go-binlog",
        "@com_github_stretchr_testify//require",
        "@org_golang_google_grpc//:grpc",
        "@org_golang_google_grpc//credentials/insecure",
        "@org_uber_go_goleak//:goleak",
    ],
)
